import { ADD, SUB, DDADD, JISHUADD, ODDADD } from "./context"
let initNum = 0
export default function countReducers(preSatate = initNum, action) {
    let { type, data } = action
    switch (type) {
        case ADD:
            return preSatate + data
        case SUB:
            return preSatate - data
        case ODDADD:
            return preSatate + data
        case JISHUADD:
            return preSatate + data
        case DDADD:
            return preSatate + data
        default:
            return preSatate
    }
}